package com.smart.community.region.service;

import com.smart.community.region.entity.Owner;
import com.smart.community.region.entity.OwnerHousehold;
import com.smart.community.region.dto.OwnerDTO;

/**
 * 业主信息处理服务
 * 负责业主信息的新增、更新、手机号一致性检查和房户关联关系建立
 * 
 * @author Wu.Liang
 * @since 2025-08-22
 * @version 1.0.0
 */
public interface OwnerProcessingService {
    
    /**
     * 处理业主信息（新增或更新）
     * 
     * @param ownerDTO 业主信息DTO
     * @return 处理后的业主信息
     * @throws Exception 处理异常
     */
    Owner processOwnerInfo(OwnerDTO ownerDTO) throws Exception;
    
    /**
     * 建立业主房户关联关系
     * 
     * @param ownerId 业主ID
     * @param householdId 房户ID
     * @throws Exception 关联异常
     */
    void createOwnerHouseholdAssociation(Long ownerId, Long householdId) throws Exception;
    
    /**
     * 新增业主并关联房户（完整流程）
     * 
     * @param ownerDTO 业主信息DTO
     * @param householdId 房户ID
     * @return 处理后的业主信息
     * @throws Exception 处理异常
     */
    Owner addOwnerWithHousehold(OwnerDTO ownerDTO, Long householdId) throws Exception;
    
    /**
     * 检查业主房户关联关系是否存在
     * 
     * @param ownerId 业主ID
     * @param householdId 房户ID
     * @return 是否存在关联关系
     * @throws Exception 检查异常
     */
    boolean checkAssociationExists(Long ownerId, Long householdId) throws Exception;
}
